<?php
$params = array_merge(
    require(__DIR__ . '/../../common/config/params.php'),
    require(__DIR__ . '/../../common/config/params-local.php'),
    require(__DIR__ . '/params.php'),
    require(__DIR__ . '/params-local.php')
);

return [
    'id' => 'app-api',
    'name'=>'销售会',
    'version'=>'1.0.0',
    'basePath' => dirname(__DIR__),
    'bootstrap' => [
        'log',
    ],
    'controllerNamespace' => 'api\common\controllers',
    'modules'=>[
        'v1'=>[
            'class'=>'api\modules\v1\Module',
            'basePath'=>'@api/modules/v1'
        ],
        'v2'=>[
            'class'=>'api\modules\v2\V2',
            'basePath'=>'@api/modules/v2'
        ],
    ],
    'components' => [
        'user' => [
            'class'=>'yii\web\User',
            'identityClass' => 'common\models\Login',
            'enableAutoLogin' => true,
            'enableSession'=>false,
            'loginUrl'=>null
        ],
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['info', 'warning'],
                ],
                [
                        'class' => 'yii\log\DbTarget',
                        'levels' => ['error'],
                        'categories' => [
                            'yii\db\*',
                    ],
                ],
            ],
        ],
        'errorHandler' => [
//            'errorAction' => 'site/error',
        ],
        'urlManager' => [
            'enablePrettyUrl' => true,
            'showScriptName' => true,
        ],
    ],
    'params' => $params,
];
